FROM  node:9.1-alpine
MAINTAINER  zqinggm <zqing90@126.com>

#aira2 rpc secret
ENV ARIA2C_RPC_SECRET=123456

#change source list
RUN echo "http://mirrors.cloud.aliyuncs.com/alpine/v3.7/main" > /etc/apk/repositories && \
echo "http://mirrors.cloud.aliyuncs.com/alpine/v3.7/community" >> /etc/apk/repositories && \
apk update && apk add --no-cache aria2 git

#create dir & session file
RUN mkdir -p /aria2/conf && mkdir -p /aria2/down

RUN git clone https://github.com/binux/yaaw.git

#copy files
COPY node-server.js /yaaw
COPY aria2.conf /aria2/conf/
COPY start.sh /yaaw/start.sh

VOLUME ["/aria2/down/"]

EXPOSE 8080 6800

WORKDIR /yaaw/
CMD ./start.sh
